import 'package:flutter/material.dart';
import 'package:flutterdemo01/demo56/HomeDatas.dart';
import 'package:flutterdemo01/demo56/main.dart';

class Register3 extends StatefulWidget {
  var arguments;
    Register3({Key? key, this.arguments='空'}) : super(key: key);

  @override
  _Register3State createState() => _Register3State();
}

class _Register3State extends State<Register3> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('注册3页面'),),
      body: Column(
        children: [
          SizedBox(height: 300,),
          ElevatedButton(onPressed: (){

            // Navigator.of(context).pushNamedAndRemoveUntil(
            //  "/"
            // , (route) => false);//true保留跳转的当前栈   false 不保留

            // Navigator.pushNamedAndRemoveUntil(
            //   context,
            //   "/register2", (route) => false,arguments: 'hhhhh'//true保留跳转的当前栈   false 不保留
            // );

            // Navigator.pushNamedAndRemoveUntil(
            //   context,
            //   "/register2", (route) => false//true保留跳转的当前栈   false 不保留
            // );

            Navigator.of(context).pushNamedAndRemoveUntil('/', (route) => false, arguments: {'d':1});

          }, child: Text('完成  ${widget.arguments}')),
        ],
      ),
    );
  }
}
